package com.systop.mapper;

import com.systop.pojo.Banner;
import com.systop.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author zhangnan
 * @Data 2020/8/003 上午 9:28
 * @Descriiption
 **/
@Mapper
public interface BannerMapper {
    //首页上传Banner
    @Insert("insert into banners(banner_name,banner_describtion,banner_photo) " +
            "values(#{banner_name},#{banner_describtion},#{banner_photo})")
    Integer insertbanners(Banner banner);
    //查询banner
    @Select("select * from banners")
    List<Banner> selectBannerAll();
    //更新之前查询
    @Select("select * from banners where banner_id=#{banner_id}")
    Banner selectBannerByid(Integer banner_id);
    //根据id修改Bannner
    @Update("update banners set banner_name=#{banner_name},banner_describtion=#{banner_describtion},banner_photo=#{banner_photo} where banner_id=#{banner_id}")
    Integer updateBannerByid(Banner banner);
    //根据id删除banner
    @Delete("delete from banners where banner_id=#{banner_id}")
    Integer deleteBannerByid(Integer banner_id);
}
